package org.harsh.transmission.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 传输任务对象 trans_task
 * 
 * @author liuhaibo
 * @date 2024-08-25
 */
public class TransTask extends BaseEntity implements Comparable<TransTask>
{
    private static final long serialVersionUID = 1L;

    /** 传输任务ID */
    private Long taskId;

    /** 消息ID */
    @Excel(name = "消息ID")
    private Long msgId;

    /** 传输任务优先级 */
    @Excel(name = "传输任务优先级")
    private Long taskPriority;

    /** 传输任务类型 */
    @Excel(name = "传输任务类型")
    private Long taskType;

    /** 消息接收节点 */
    @Excel(name = "消息接收节点")
    private Long recvNode;

    /** 消息接收地址 */
    @Excel(name = "消息接收地址")
    private String recvAddr;

    /** 消息接收端口 */
    @Excel(name = "消息接收端口")
    private int recvPort;

    /** 传输任务状态 */
    @Excel(name = "传输任务状态")
    private Long taskStatus;

    /** 传输任务偏移 */
    @Excel(name = "传输任务偏移")
    private Long taskOffset;

    /** 开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date startTime;

    /** 完成时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date overTime;

    public void setTaskId(Long taskId) 
    {
        this.taskId = taskId;
    }

    public Long getTaskId() 
    {
        return taskId;
    }

    public void setMsgId(Long msgId) 
    {
        this.msgId = msgId;
    }

    public Long getMsgId() 
    {
        return msgId;
    }

    public void setTaskPriority(Long taskPriority) 
    {
        this.taskPriority = taskPriority;
    }

    public Long getTaskPriority() 
    {
        return taskPriority;
    }

    public void setTaskType(Long taskType) 
    {
        this.taskType = taskType;
    }

    public Long getTaskType() 
    {
        return taskType;
    }

    public void setRecvNode(Long recvNode) 
    {
        this.recvNode = recvNode;
    }

    public Long getRecvNode() 
    {
        return recvNode;
    }

    public String getRecvAddr() {
        return recvAddr;
    }

    public void setRecvAddr(String recvAddr) {
        this.recvAddr = recvAddr;
    }

    public int getRecvPort() {
        return recvPort;
    }

    public void setRecvPort(int recvPort) {
        this.recvPort = recvPort;
    }

    public void setTaskStatus(Long taskStatus)
    {
        this.taskStatus = taskStatus;
    }

    public Long getTaskStatus() 
    {
        return taskStatus;
    }

    public void setTaskOffset(Long taskOffset) 
    {
        this.taskOffset = taskOffset;
    }

    public Long getTaskOffset() 
    {
        return taskOffset;
    }

    public void setStartTime(Date startTime) 
    {
        this.startTime = startTime;
    }

    public Date getStartTime() 
    {
        return startTime;
    }

    public void setOverTime(Date overTime) 
    {
        this.overTime = overTime;
    }

    public Date getOverTime() 
    {
        return overTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("taskId", getTaskId())
            .append("msgId", getMsgId())
            .append("taskPriority", getTaskPriority())
            .append("taskType", getTaskType())
            .append("recvNode", getRecvNode())
                .append("recvAddr", getRecvAddr())
                .append("recvPort", getRecvPort())
            .append("taskStatus", getTaskStatus())
            .append("taskOffset", getTaskOffset())
            .append("startTime", getStartTime())
            .append("overTime", getOverTime())
            .toString();
    }

    @Override
    public int compareTo(TransTask o) {
        return this.getTaskPriority() > o.getTaskPriority() ?  1 : 0;
    }
}
